package com.yunxi.vip.pojo;

import com.yunxi.order.pojo.OrderCustomerVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 体验车库存
 * </p>
 * @author
 * @since 2019-09-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="StoVehicleExp对象", description="体验车库存")
public class StoVehicleExpVO implements Serializable {

    private static final long serialVersionUID = 1L;

    private String expId;

    private String partnerCode;
    private String partnerName;
    private String partnerFinance;
    private String partnerFinanceName;

    private BigDecimal gpsX;

    private BigDecimal gpsY;

    @ApiModelProperty(value = "可签约，可提车")
    private Integer hireStatus;
    private Integer hireStatusNot;
    private String hireStatusCn;
    private Integer hireCurStatus;
    private String hireCurStatusCn;

    @ApiModelProperty(value = "1排产订单已确认2排产中3已生产4运输中5已到店")
    private Integer vehicleStatus;
    private String vehicleStatusCn;
    private String orderVehicleId;
    private String detailId;
    private String carState;
    private Integer hireCount;
    private Integer hireDuration;
    private String attachUrl;
    private String orderCustomerNo;
    private String customOrderNo;

    private String catalogName;
    private String seriesName;
    private String colorNameIn;
    private String colorNameOut;
    private String vin;
    private Date hireStartDate;
    private Date hireEndDate;
    private String vipId;
    private String vipNo;
    private String vipName;
    private String customerName;
    private String customerMobile;
    private String certNo;
    private Integer dayed;
    private Integer warnStatus;
    private String businessType;
    private Integer checkSalesStatus;
    private String checkSalesStatusCn;

    private List<OrderCustomerVO> orderCustomerList = new ArrayList<OrderCustomerVO>();

    private String applyNo;
    private Integer submitType;
    private Date createTime;
    private Date actualOfflineTime;
    private OrderCustomerVO curOrderCustomer;
    private String orderCarId;
    private String payway;
    private Integer isReported;

    public void setCarState(String carState) {
        this.carState = carState;
        //1排产订单已确认2排产中3已生产4运输中5已到店
        if(carState!=null){
            if (carState.equals("01DSC")//排产中
            ) {
                vehicleStatus = 2;
                vehicleStatusCn = "排产中";
            } else if (carState.equals("02ZZSX")
                    || carState.equals("03ZZXX")
                    || carState.equals("04HZSX")
                    || carState.equals("05HZXX")
                    || carState.equals("06TZSX")
                    || carState.equals("07TZXX")
            ) {
                vehicleStatus = 2;
                vehicleStatusCn = "排产中";
            } else if (carState.equals("08CLXX")
                ||carState.equals("09PDI")
                ||carState.equals("10VDCRK")
                    ||carState.equals("11VDCCK")
                    ||carState.equals("13QDSC")
            ) {
                vehicleStatus = 3;
                vehicleStatusCn = "已生产";
            }else if(carState.equals("12FYZT")){
                vehicleStatus = 4;
                vehicleStatusCn = "运输中";
            }else if(carState.equals("14QDRK")
                    ||carState.equals("15LSCK")
                    ||carState.equals("16LSTH")
                    ||carState.equals("17THRK")
                    ||carState.equals("18THCK")
                ){
                vehicleStatus = 5;
                vehicleStatusCn = "已到店";
            }else{
                vehicleStatus = 2;
                vehicleStatusCn = "排产中";
            }
        }else{
            vehicleStatus = 1;//排产订单已确认
            vehicleStatusCn = "排产订单已确认";
        }
    }
}
